#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <time.h>

using namespace std;

int main()
{
    ofstream outFile;
    string outName;
    int numSensors;
    int minBattery, maxBattery;
    int maxX, maxY;

    srand(time(NULL));

    cout << "Please enter filename: ";
    cin >> outName;

    outFile.open(outName.c_str());

    cout << "Please enter number of sensors: ";
    cin >> numSensors;
    cout << "Please enter minimum battery level: ";
    cin >> minBattery;
    cout << "Please enter maximum battery level: ";
    cin >> maxBattery;
    cout << "Please enter maximum X value: ";
    cin >> maxX;
    cout << "Please enter maximum Y value: ";
    cin >> maxY;

    outFile << numSensors << endl;

    for(int i = 0; i < numSensors; ++i)
    {
        outFile << i << " ";
        outFile << rand()%(maxBattery-minBattery)+minBattery << " ";
        outFile << rand()%maxX << " ";
        outFile << rand()%maxY << endl;
    }

    outFile.close();

    return 0;
}
